package Exercise;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Date;
import java.util.Scanner;

public class ContextExe2 {

    public static void main(String[] args) throws ParseException {
        //10进制转换成2进制
//        Scanner sc=new Scanner(System.in);
//        System.out.println("输入数字");
//        int i=Integer.parseInt(sc.nextLine());
//        String s = MytoBinaryString(i);
//        System.out.println(s);

        //计算活了多少天
//        Scanner sc=new Scanner(System.in);
//        System.out.println("输入生日，年月日");
//        String birth= sc.nextLine();
//        SimpleDateFormat d=new SimpleDateFormat("yyyy年MM月dd日");
//        Date day=d.parse(birth);
//
//        long time = System.currentTimeMillis()-day.getTime();
//        long year=time/1000/60/60/24;
//        System.out.println("活了"+year+"天");

//
//        LocalDate a= LocalDate.of(2005,3,31);
//        LocalDate b=LocalDate.now();
//        long between = ChronoUnit.DAYS.between(a, b);
//        System.out.println(between);



//        Calendar c=Calendar.getInstance();
//        c.set(2000,2,1);
//        c.add(Calendar.DAY_OF_MONTH,-1);
//
//        int day=c.get(Calendar.DAY_OF_MONTH);
//        System.out.println(day);



    }







    public static String MytoBinaryString(int val){
        StringBuilder sb=new StringBuilder();
        while(val>0){
            sb.append(val%2);
            //sb.Insert(0,val%2);  //不用逆转
            val/=2;
        }
        return sb.reverse().toString();
    }



}
